//Win32 API's needed
[DllImport("user32", EntryPoint = "FindWindowExA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
public static extern long FindWindowEx(long hWnd1, long hWnd2, string lpsz1, string lpsz2);

[DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
public static extern long SetWindowPos(long hWnd, long hWndInsertAfter, long X, long Y, long cx, long cy, long wFlags);

/// <summary>
/// method for handling the showing/hiding of the desktop icons
/// </summary>
/// <param name="show">condition: show or hide</param>
/// <returns>true/false</returns>
public bool ShowHideDesktopIcons(bool show)
{
    try
    {
        //get a handle to the desktop ("Progman")
        long winHandle = FindWindowEx(0L, 0L, "Progman", null);

        //determine if we're showing or hiding
        switch (show)
        {
            case true:
                ShowWindow(winHandle, 0);
                break;
            case false:
                ShowWindow(winHandle, 5);
                break;
        }
        return true;
    }
    catch (Win32Exception ex)
    {
        MessageBox.Show(ex.ToString());
        return false;
    }
    
}